package org.ddd.book.interfaces.eventsubscribe;

import com.google.common.eventbus.AsyncEventBus;
import org.springframework.beans.factory.annotation.Autowired;

import javax.annotation.PostConstruct;

public abstract class BaseEventBusSubscribe {
    @SuppressWarnings("all")
    @Autowired
    private AsyncEventBus asyncEventBus;

    @SuppressWarnings("all")
    @PostConstruct
    public void init() {
        // 注册消费
        asyncEventBus.register(this);
    }
}
